<template>
  <el-card class="box-card">
    <el-avatar
      src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
    ></el-avatar>
    <span>{{ userInfo.userRole === 1 ? "管理员" : "普通用户" }}</span>
    <el-descriptions>
      <el-descriptions-item label="用户名">{{
        userInfo.username
      }}</el-descriptions-item>
      <el-descriptions-item label="创建日期">{{
        userInfo.creationDate
      }}</el-descriptions-item>
    </el-descriptions>
  </el-card>
</template>

<script>
import { mapState } from "vuex";
export default {
  computed: {
    ...mapState({
      userInfo: (state) => state.user.userInfo,
    }),
  },
};
</script>

<style lang="less" scoped>
.box-card {
  width: 480px;
  margin-top: 30px;
  padding: 20px;
}
.el-descriptions {
  margin-top: 30px;
}
span {
  margin-left: 20px;
}
</style>
